SELECT COUNT(1)
FROM FD_DICTIONARY_TY T
WHERE 1                      =1
<#if (CODE!) != ''>
  AND (INSTR (T.CODE, :CODE )             > 0
  OR INSTR (T.NAME, :CODE )               > 0)
</#if>
<#if (VALUE!) != ''>
  AND INSTR (T.VALUE, :VALUE )            > 0
</#if>
<#if (DICTIONARY_CODE!) != ''>
  AND EXISTS
    (SELECT 1
    FROM FD_DICTIONARY ED
    WHERE ED.TYPE_ID                        = T.ID
    AND (INSTR (ED.CODE, :DICTIONARY_CODE ) > 0
    OR INSTR (ED.NAME, :DICTIONARY_CODE )   > 0)
    )
</#if>
